<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>会员个人信息</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link rel="stylesheet" type="text/css" href="<%=basePath%>CSS/style.css">
	<link rel="stylesheet" type="text/css" href="<%=basePath%>JS/jquery-ui-1.11.2/jquery-ui.css">
	<script type="text/javascript" src="<%=basePath%>JS/jquery-ui-1.11.2/external/jquery/jquery.js"></script>
	<script type="text/javascript" src="<%=basePath%>JS/jquery-ui-1.11.2/jquery-ui.js"></script>
  	<% 
  		String memberID = request.getParameter("memId");
  		String isSelf = "no";
  	    //如果请求页面不是当前用户
  		if(memberID==null){
  			memberID = session.getAttribute("memberID").toString(); 
  			  isSelf="yes";
  			}
  	%>
  	<script>
  		$(function(){
  		 	$("#memberDiv").hide();
  			//动态获取个人信息
  			$.ajax({
  				url:"<%=basePath%>memberAction?memID=<%=memberID%>",
  				type:'GET',
  				dataType:'json',
  				timeout:1000,
  				beforeSend:LoadFunction,
  				error:errFunction,
  				success:succFunction
  			});
  		});
  		
  		function LoadFunction(){} //加载函数
  		//失败函数
  		function errFunction(){alert("数据加载失败！请刷新");}
  		function succFunction(tt){
  					var json = eval(tt);
  				 $("#memberDiv").show();
  				$("#number").text(json[0].number);
  				 $("#name").text(json[0].memname);
  				  $("#sex").text(json[0].gender);
  				 $("#borth").text(json[0].borthday);
  				 $("#homeaddr").text(json[0].homeAddr);
  				 $("#indate").text(json[0].indate);
  				 $("#shschool").text(json[0].shschool);
  				 $("#college").text(json[0].college);
  				 $("#major").text(json[0].major);
  				 $("#schooladdr").text(json[0].schooladdr);
  				 $("#phone").text(json[0].phone);
  				 $("#cortent").text(json[0].cornet);
  				 $("#email").text(json[0].email);
  				 $("#workaddr").text(json[0].workaddr);
  				$("#worktype").text(json[0].worktype);			
  				$("#position").text(json[0].position);
  				$("#detail").text(json[0].detail);
  				if(json[0].photo!=null&&json[0].photo!=""){
  					$("#photo").empty();
  					$("#photo").html("<img width='160' height='200' src='<%=basePath%>"+json[0].photo+"'/>");
  				}
  				$("#loadphoto").html("<button onclick='javascript:window.location.href=\"user/loadphoto.jsp?photo="+json[0].photo+"\"'>编辑头像</button>");
  				//非自己个人信息不可更改
  				if("<%=isSelf%>"=="no"){
  						$("#modifybtn").hide();
  						$("#loadphoto").hide();
  						
  					}
  			}			
  				
  </script>
	<style>
		div>div>span{
			margin:0px 0px 0px 20px;
			font:14px/2 "Microsoft YaHei","宋体";
		}
	</style>
  </head>
  
  <body>

   <div id="head-search">
   	 	<span class="home-path"></span>
   	 	<span class="path-font">会员信息管理&nbsp;&nbsp;>>&nbsp;&nbsp;个人信息</span>
   	 		<button id="modifybtn" style="float:right;" class="wong-button-text-ui wong-button-blue" onclick="javascript:window.location.href='user/modifyMember.jsp';">
   				<span class="wong-ui-icon wong-icon-edit"></span>
   				<span >修改</span>
   			</button>
   	</div>
   	 <div class="memberbody">
   	 		<div class="memberleft">
   	 			<div>	用&nbsp;户&nbsp;名:<span id="number"></span></div>
   	 			<div >	姓&nbsp;&nbsp;&nbsp;&nbsp;名:<span id="name"></span></div>
   	 			<div>	出生年月:<span id="borth"></span></div>
   	 			<div>	性&nbsp;&nbsp;&nbsp;&nbsp;别:<span id="sex"></span></div>
   	 			<div >	家乡地址:<span id="homeaddr"></span></div>
   	 			<div >	学校住址:<span id="schooladdr"></span></div>
  				<div >	入校年份:<span id="indate"></span></div>
  				<div >	毕业高中:<span id="shschool"></span></div>
  				<div >	联系电话:<span id="phone"></span></div>
  				<div >	短&nbsp;&nbsp;&nbsp;&nbsp;号:<span id="cortent"></span></div>
  				<div >	邮&nbsp;&nbsp;&nbsp;&nbsp;箱:<span id="email"></span></div>
  				<div >	同乡职位:<span id="position"></span>	</div>
   	 		</div>
   	 		<div class="memberright">
   	 			<div style="height:210px;width:160px;" id="photo">
   	 				<object type="application/x-shockwave-flash" style="outline:none; data="http://cdn.abowman.com/widgets/hamster/hamster.swf?up_bodyColor=f0e9cc&amp;up_feetColor=D4C898&amp;up_eyeColor=000567&amp;up_wheelSpokeColor=DEDEDE&amp;up_wheelColor=FFFFFF&amp;up_waterColor=E0EFFF&amp;up_earColor=b0c4de&amp;up_wheelOuterColor=FF4D4D&amp;up_snoutColor=F7F4E9&amp;up_bgColor=F0E4E4&amp;up_foodColor=cba920&amp;up_wheelCenterColor=E4EB2F&amp;up_tailColor=E6DEBE&amp;" width="160" height="160">
					<param name="movie" value="http://cdn.abowman.com/widgets/hamster/hamster.swf?up_bodyColor=f0e9cc&amp;up_feetColor=D4C898&amp;up_eyeColor=000567&amp;up_wheelSpokeColor=DEDEDE&amp;up_wheelColor=FFFFFF&amp;up_waterColor=E0EFFF&amp;up_earColor=b0c4de&amp;up_wheelOuterColor=FF4D4D&amp;up_snoutColor=F7F4E9&amp;up_bgColor=F0E4E4&amp;up_foodColor=cba920&amp;up_wheelCenterColor=E4EB2E&amp;up_tailColor=E6DEBE&amp;">
					<param name="AllowScriptAccess" value="always">
					<param name="wmode" value="opaque"></object>
				</div>
				<div id="loadphoto"></div>
				<div >	学&nbsp;&nbsp;&nbsp;&nbsp;院:<span id="college"></span></div>
   	 			<div >	专&nbsp;&nbsp;&nbsp;&nbsp;业:<span id="major"></span></div>
  		        <div >	工作地点:<span id="workaddr"></span></div>
  				<div >	工作类型:<span id="worktype"></span></div>
  				
   	 		</div>
   	 		<div class="memberbottom">	个人简介:<span id="detail"></span></div>
  		
   	 </div>
  </body>
</html>
